﻿<Window x:Class="DocManager.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controlli="clr-namespace:DocManagerControls.Controls;assembly=DocManagerControls"
        xmlns:classi="clr-namespace:DocManagerControls.CLASSI;assembly=DocManagerControls"
        Title="Doc. man."  Background="AliceBlue" AllowDrop="True" Width="Auto" Height="Auto" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight">
    <Window.Resources>

        <DataTemplate x:Key="ButtonMenukTemplate" DataType="{x:Type classi:MenuData}">
            <StackPanel Height="Auto" Background="{Binding Background}">
                <Image  Source="{Binding Path=IMGSource}"  Width="24" Height="18" Stretch="Uniform" />
                <TextBlock Text="{Binding Path=Caption}" HorizontalAlignment="Center"></TextBlock>
            </StackPanel>
        </DataTemplate>

        <ControlTemplate TargetType="Button" x:Key="ButtonControlTemplate">
            <Grid Margin="2" Width="Auto" Height="Auto">
                <Grid.RenderTransform>
                           <RotateTransform Angle="0" CenterX="50" CenterY="50" />
                </Grid.RenderTransform>
                <Border BorderBrush="Orange" BorderThickness="2" CornerRadius="3" Background="{TemplateBinding Background}" Padding="2">
                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </Border>

                <Grid.Triggers>
                    <EventTrigger RoutedEvent="Grid.MouseDown">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation                               
                                Storyboard.TargetProperty="(RenderTransform).(RotateTransform.Angle)"
                                From="0" To="360" Duration="0:0:0.5" 
                                AutoReverse="False" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Grid.Triggers>


            </Grid>
        </ControlTemplate>

    </Window.Resources>

        <!--Width="{Binding Width, RelativeSource={RelativeSource AncestorType=Window}}"-->
        <Grid AllowDrop="True" DockPanel.Dock="Top" Width="Auto" Height="Auto" Name="myGrid1">
        <Grid.RowDefinitions >
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition Height="30" MinHeight="30"></RowDefinition>
            </Grid.RowDefinitions>
        <Menu Grid.Row="0" Grid.Column="0" Height="23"  MinHeight="23"  HorizontalAlignment="Left" 
              Margin="1" Name="menu1" VerticalAlignment="Top" MinWidth="400" MenuItem.Click="menu1_Click"   >
            <MenuItem Header="Exit" Icon=""/>
            <MenuItem Header="Documenti" />                      
            <MenuItem Header="Flussi"></MenuItem>
            <MenuItem Header="Utenti"></MenuItem>
            <MenuItem Header="Tabelle"></MenuItem>

            <MenuItem Header="Utility">
                <MenuItem Header="Servizi PC"></MenuItem>
                <MenuItem Header="LogView"></MenuItem>
                <MenuItem Header="NetworkInfoControl"></MenuItem>
            </MenuItem>

            </Menu>
        <ToolBarTray Grid.Row="1" Grid.Column="0"  Background="Gold" Height="Auto">
                <ToolBar Name="toolBar1" Band="1" BandIndex="1" MenuItem.Click="toolBar1_Click" />
        </ToolBarTray>
        <!-- -->
        <Frame Name="frameContainer" Grid.Row="2" BorderBrush="Transparent" BorderThickness="2" AllowDrop="True" Width="Auto" Height="Auto"               
            Padding="2"  HorizontalContentAlignment="Left" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Top" VerticalContentAlignment="Top" SizeChanged="frameContainer_SizeChanged">
           <!--<Frame.Content>
                <controlli:CaricaDocControl/>
            </Frame.Content>-->
        </Frame>

        <StatusBar Grid.Row="3"  Height="Auto" Width="Auto" Background="Transparent" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="1" Name="statusBar1">
                <StatusBarItem Name="Dominio"></StatusBarItem>
                <StatusBarItem Name="PcUser"></StatusBarItem>
                <StatusBarItem Name="DbName"></StatusBarItem>
                <StatusBarItem Name="DbState"></StatusBarItem>
                <StatusBarItem Name="IP"></StatusBarItem>
        </StatusBar>

    </Grid>

</Window>
